home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
ELECTRIC
/
DSPICE0S.ZIP
/
cdiv.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-11-22
|
1KB
|
35 lines
/* cdiv.f -- translated by f2c (version of 3 February 1990 3:36:42).
You must link the resulting object file with the libraries:
-lF77 -lI77 -lm -lc (in that order)
*/
#include "f2c.h"
/*< subroutine cdiv(xr,xi,yr,yi,cr,ci) >*/
/* Subroutine */ int cdiv_(xr, xi, yr, yi, cr, ci)
doublereal *xr, *xi, *yr, *yi, *cr, *ci;
{
static doublereal amag2, xitemp, yitemp, xrtemp, yrtemp;
/* .. ok if cr and ci are really xr and xi or yr and yi */
/*< implicit double precision (a-h,o-z) >*/
/*< xrtemp=xr >*/
xrtemp = *xr;
/*< xitemp=xi >*/
xitemp = *xi;
/*< yrtemp=yr >*/
yrtemp = *yr;
/*< yitemp=yi >*/
yitemp = *yi;
/*< amag2=yrtemp*yrtemp+yitemp*yitemp >*/
amag2 = yrtemp * yrtemp + yitemp * yitemp;
/*< cr=(xrtemp*yrtemp+xitemp*yitemp)/amag2 >*/
*cr = (xrtemp * yrtemp + xitemp * yitemp) / amag2;
/*< ci=(xitemp*yrtemp-xrtemp*yitemp)/amag2 >*/
*ci = (xitemp * yrtemp - xrtemp * yitemp) / amag2;
/*< return >*/
return 0;
/*< end >*/
} /* cdiv_ */